// 下载excel文件流
const excelDownload = (content: string, fileName: string = '账号列表.xlsx') => {
  let blob = new Blob([content])
  if ('download' in document.createElement('a')) {
    // 非IE下载
    let link = document.createElement('a')
    link.download = fileName
    link.style.display = 'none'
    link.href = URL.createObjectURL(blob)
    document.body.appendChild(link)
    link.click()
    URL.revokeObjectURL(link.href) // 释放URL 对象
    document.body.removeChild(link)
  } else {
    // 兼容IE10+下载
    const nav = window.navigator as any
    nav.msSaveBlob(blob, fileName)
  }
}

export { excelDownload }
